package main.java.service.impl;

import dao.SysRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.SysRole;
import service.SysRoleService;

import java.util.List;
@Service
public class SysRoleServiceImpl implements SysRoleService {
    @Autowired
    private SysRoleMapper sysRoleMapper;
    @Override
    public List<SysRole> list(SysRole sysRole) {
        return sysRoleMapper.list(sysRole);
    }

    @Override
    public boolean add(SysRole sysRole){
        boolean result = false;
        try {
            if (sysRoleMapper.add(sysRole)==1){
                result = true;
            }
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
        return result;
    }
}
